#pragma warning(disable:4996)
//自动计费系统
#include<stdio.h>
int main()
{
	int count;//购票的数量
	scanf("%d", &count);
	if (count < 30)
		printf("%d", count * 50);
	else
		printf("%d", count * 48);
	return 0;
}